#pragma once
#include "RobotInstance.h"

namespace RobotPlant { namespace RobotProxy{
	using namespace std;
	using namespace boost::join;
	using namespace RobotPlant::Common;

	RP_ROBOTPROXY_TEMPLATE template class RP_ROBOTPROXY_API vector<RobotInstance*>;

	/*
	Robot manager keeps the robot instances.
	*/
	class RP_ROBOTPROXY_API RobotManager: public joint
	{
	protected:
		/*
		The robot manager mutex.
		*/
		boost::mutex _mutex;

		/*
		The robot instances vector.
		*/
		vector<boost::shared_ptr<RobotInstance>> _robInstances;

	public:
		/*
		Constructor
		*/
		RobotManager(joint::spawn_type e=0);

		/*
		Destructor
		*/
		~RobotManager();

		/*
		Gets the robot instance by the specified index.
		*/
		boost::shared_ptr<RobotInstance> GetRobot(int index);

		/*
		Gets the robot instances' count.
		*/
		int GetRobotCount();

	protected:
	};
}}
